<template>
	<view class="page">
		<view class="page-search">
			<u-search :showAction="true" actionText="搜索" :animation="false"></u-search>
		</view>
		<view class="page-content">
			<view class="">
				<scroll-view scroll-y="true" :style="{
					'height':`calc(100vh - ${statusBarHeight + 1}px)` ,
					'background-color':'#fff',
				}">
					<view class="left">
						<view @click="leftClickHandle(index,item)" :class="active===index?'active':''"
							v-for="(item,index) in phoneModelList">
							{{item.name}}
						</view>
					</view>
				</scroll-view>
			</view>
			<view class="page-content-right">
				<view class="page-content-right-item" v-for="(item,index) in list" :key="index" @click="navigatorTo('./detail')">
					{{ item.name }}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			let statusBarHeight = uni.getSystemInfoSync().windowTop || 0
			return {
				statusBarHeight: 0,
				phoneModelList: [{
						name: '华为'
					},
					{
						name: '小米'
					},
					{
						name: 'oppo'
					},
					{
						name: 'vivo'
					},
					{
						name: '华为'
					},
					{
						name: '小米'
					},
					{
						name: 'oppo'
					},
					{
						name: 'vivo'
					},
					{
						name: '华为'
					},
					{
						name: '小米'
					},
					{
						name: 'oppo'
					},
					{
						name: 'vivo'
					},
					{
						name: '华为'
					},
					{
						name: '小米'
					},
					{
						name: 'oppo'
					},
					{
						name: 'vivo'
					},
				],
				active: 0,
				list: [{
						name: '苹果iPhone 15 Pro Max',
					},
					{
						name: '苹果iPhone 15 Pro Max',
					},
					{
						name: '苹果iPhone 15 Pro Max',
					},
					{
						name: '苹果iPhone 15 Pro Max',
					},
				],
			};
		},
		methods: {
			leftClickHandle(index, data) {
				this.active = index
			},
			navigatorTo(data){
				uni.navigateTo({
					url:data
				})
			}
		}
	}
</script>

<style lang="less" scoped>
	page {
		// padding: 20rpx;
		width: 100%;
		box-sizing: border-box;
		letter-spacing: 3rpx;
		font-size: 32rpx;
		color: #212121;
		background: #f9f9f9;
	}

	/deep/ .u-search__action {
		font-size: 32rpx;
		color: #0085FF;
	}

	.page {
		&-search {
			padding: 20rpx;
		}

		&-content {
			display: flex;

			.left {
				width: 200rpx;
				height: 100%;

				view {
					height: 100rpx;
					line-height: 100rpx;
					color: #666;
					text-align: center;
					font-size: 28rpx;
					position: relative;
				}
				// :before {
				// 	position: absolute;
				// 	top: 50%;
				// 	left: 0px;
				// 	width: 6rpx;
				// 	height: 42rpx;
				// 	background: linear-gradient(180deg, #0085FF 0%, #98CEFF 100%);
				// 	border-radius: 4rpx;
				// 	transform: translateY(-50%);
				// 	content: ' ';
				// }
			}

			&-right {
				margin-left: 20rpx;
				width: 100%;
				background: #FFFFFF;
				border-radius: 20rpx;
				padding: 0 40rpx;
				font-size: 26rpx;
				font-family: PingFangSC, PingFang SC;
				font-weight: 400;
				color: #000000;

				&-item {
					padding: 18rpx 0;
					border-bottom: 1px solid #EDEDED;
				}
			}
		}
	}

	.active {
		font-size: 28rpx;
		font-family: PingFangSC, PingFang SC;
		font-weight: 400;
		color: #000000;
		background: #F9F9F9;
	}
</style>